package com.example.listener;

/**
 * @className: a
 * @author: Joe
 * @create: 2023-02-07 17:29
 * @description:
 */

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @className: MqListener
 * @author: Joe
 * @create: 2022-12-05 12:06
 * @description:mq监听器
 */
@Component
@RocketMQMessageListener(topic = "pay-topic",consumerGroup = "${rocketmq.consumer.group}")
public class MqListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String s) {
        //在这里给用户发送消息
        System.err.println("尊敬的"+s+"您好，您的支付已成功");
    }
}